package com.zbkj.service.model.front.vo.log;

import com.zbkj.dal.entity.ba.EbSupplyOrderOperateLogEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author wangzhengyan
 * @date 2024/4/6 2:43 PM
 */
@Data
@ApiModel(description = "供享订单操作日志")
public class ShareOrderLogVO {

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "操作类型")
    private String operateType;

    @ApiModelProperty(value = "用户ID")
    private Integer operateId;

    @ApiModelProperty(value = "操作人")
    private String operator;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "操作时间")
    private LocalDateTime operateTime;

    public static ShareOrderLogVO build(EbSupplyOrderOperateLogEntity entity) {
        if (entity == null) {
            return null;
        }
        ShareOrderLogVO vo = new ShareOrderLogVO();
        vo.setOrderNo(entity.getOrderNo());
        vo.setOperateType(entity.getOperateType());
        vo.setOperateId(entity.getOperateId());
        vo.setOperator(entity.getOperator());
        vo.setContent(entity.getContent());
        vo.setOperateTime(entity.getCreatedAt());
        return vo;
    }

}
